package com.qky.note.part9labeleExpr;

import org.antlr.v4.runtime.CharStreams;
import org.antlr.v4.runtime.CodePointCharStream;
import org.antlr.v4.runtime.CommonTokenStream;
import org.antlr.v4.runtime.tree.ParseTree;

public class test {
    public static void main(String[] args) {
        CodePointCharStream input = CharStreams.fromString("a=5" +
                " b=6" +
                " a+b clear a+b");
        LabeledExprLexer lexer = new LabeledExprLexer(input);
        CommonTokenStream tokens = new CommonTokenStream(lexer);
        LabeledExprParser parser = new LabeledExprParser(tokens);
        ParseTree tree = parser.prog(); // parse
//
        EvalVisitor eval = new EvalVisitor();
        eval.visit(tree);
    }
}
